import request from '@renderer/utils/request';
import { AxiosPromise } from 'axios';
import { callWorkResult, endData, arrivalData } from './types';

export function callWork(): AxiosPromise<callWorkResult> {
  return request({
    url: 'http://192.168.31.163:8558/pc/callWork/count',
    method: 'get'
  });
}

// 开始叫号
export function call() {
  return request({
    url: 'http://192.168.31.163:8558/pc/callWork/call',
    method: 'get'
  });
}

// 到场
export function arrival(data: arrivalData) {
  return request({
    url: 'http://192.168.31.163:8558/pc/callWork/arrival',
    method: 'get',
    params: data
  });
}

// 暂停叫号
export function end(data: endData) {
  return request({
    url: 'http://192.168.31.163:8558/pc/callWork/end',
    method: 'get',
    params: data
  });
}

// 过号
export function pass(data: endData) {
  return request({
    url: 'http://192.168.31.163:8558/pc/callWork/pass',
    method: 'get',
    params: data
  });
}

// 重叫
export function againCall() {
  return request({
    url: 'http://192.168.31.163:8558/pc/callWork/againCall',
    method: 'get'
  });
}

// 是否叫号
export function nowAudio(data) {
  return request({
    url: 'http://192.168.31.163:8558/pc/callWork/nowAudio',
    method: 'get',
    params: data
  })
}
